package com.leo.train.business.service;

import com.leo.train.business.dto.DailyTrainTicketDto;
import com.leo.train.business.entity.DailyTrain;
import com.leo.train.business.entity.DailyTrainTicket;
import com.leo.train.common.resp.PageResult;

import java.util.Date;

public interface DailyTrainTicketService {
    /**
     * 保存
     * @param dailyTrainTicket
     */
    void save(DailyTrainTicket dailyTrainTicket);

    /**
     * 查询
     * @param dailyTrainTicketDto
     * @return
     */
    PageResult<DailyTrainTicket> list(DailyTrainTicketDto dailyTrainTicketDto);

    /**
     * 删除
     * @param id
     */
    void delete(Long id);

    /**
     * 查询详情
     * @param id
     * @return
     */
    DailyTrainTicket detail(Long id);

    /**
     * 生成某日车次所有余票数据
     * @param dailyTrain
     * @param date
     * @param trainCode
     */
    void genDaily(DailyTrain dailyTrain, Date date, String trainCode);

    /**
     * 定义按唯一键查询余票记录
     * @param trainCode 车次编号
     * @param date 日期
     * @param start 出发站
     * @param end 到达站
     * @return
     */
    DailyTrainTicket selectByUnique(String trainCode, Date date, String start, String end);
}
